package com.springTest;

import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author wang
 * @Description
 * @create 2021-10-29 17:16
 */
public class SpringTest {
    public static void main(String[] args) {
        AbstractApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        Teacher bean = ac.getBean(Teacher.class);
        String name = bean.getName();
        System.out.println(name);
//        Student bean1 = ac.getBean(Student.class);
        System.out.println(bean.getStudent());
        System.out.println(bean.getStudent());
        System.out.println(bean);
        System.out.println(bean);
//        System.out.println(bean1);
    }
}
